package com.example.demo.util;

import com.example.demo.pojo.Legend;
import com.example.demo.pojo.LegendDetail;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class LegendDetailUtil {
    @Value("${minio.firstSkillUrl}")
    private String firstSkillUrl;
    @Value("${minio.secondSkillUrl}")
    private String secondSkillUrl;
    @Value("${minio.thirdSkillUrl}")
    private String thirdSkillUrl;
    @Value("${minio.forthSkillUrl}")
    private String forthSkillUrl;
    @Value("${minio.fifthSkillUrl}")
    private String fifthSkillUrl;
    @Value("${minio.legendDescription}")
    private String legendDescription;
    @Value("${minio.legendPhotoUrl}")
    private String legendPhotoUrl;

    public  LegendDetail setALll(Legend legend,LegendDetail ld){
        String legendId = legend.getLegendId().toString();
        ld.setLegendPhotoUrl(legendPhotoUrl+legendId+".png");
        ld.setLegendDescription(legendDescription);
        ld.setFirstSkillUrl(firstSkillUrl+legendId+".png");
        ld.setSecondSkillUrl(secondSkillUrl+legendId+".png");
        ld.setThirdSkillUrl(thirdSkillUrl+legendId+".png");
        ld.setForthSkillUrl(forthSkillUrl+legendId+".png");
        ld.setFifthSkillUrl(fifthSkillUrl+legendId+".png");
        return ld;
    }
}
